package com.example.automanagement.mapper;

import com.example.automanagement.entity.AutoStatus;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AutoStatusMapper {
    @Insert("insert into auto_status(auto_id, auto_status) values (#{autoId},#{autoStatus})")
    void addAutoStatus(AutoStatus autoStatus);

    @Update("update auto_status set auto_status = '忙碌中' where auto_id = #{autoId}")
    void updateAutoBusy(String autoId);

    @Update("update auto_status set auto_status = '维修中' where auto_id = #{autoId}")
    void updateAutoRepairing(String autoId);

    @Update("update auto_status set auto_status = '空闲' where auto_id = #{autoId}")
    void updateAutoFree(String autoId);

    @Delete("delete from auto_status where auto_id = #{autoId}")
    void deleteAutoStatus(String autoId);
    @Select("select * from auto_status")
    List<AutoStatus> getAllAutoStatus();
}
